package site.timers.chat.exception;

import lombok.Getter;

/**
 * @className: ApplicationException
 * @author: twl
 * @date: 2024/12/10 13:49
 * @version: 1.0
 * @description:
 */
@Getter
public class ApplicationException extends RuntimeException {

    private final int code;

    private final String msg;

    public ApplicationException(Exception e) {
        super(e);
        code = 500;
        msg = e.getMessage();
    }

    public ApplicationException(String message) {
        super(message);
        this.code = 500;
        this.msg = message;
    }

    public ApplicationException(int code, String message) {
        super(message);
        this.code = code;
        this.msg = message;
    }
}
